<template>
	<navigator hover-class="none" url="/pages/index/index" open-type="switchTab" style="width: 100%;height: 100%;overflow: hidden;" :style="{background: background}">
	   <image :src="start_img" mode="widthFix" class="start_img" :style="'margin-top:' + margin_top + 'rpx'"></image>
	</navigator>
</template>
<script>
	let app = getApp();
	export default {
		data() {
			return {
				background: 'none',
				start_img: '',
				margin_top: 0,
			};
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onLoad(options) {
			//记录推广人uid
			if (options.scene) {
				let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
				//记录推广人uid
				if (value.pid) app.globalData.spid = value.pid;
			}
			if (options.spid) app.globalData.spid = options.spid;
			var that = this;
			var start_img = uni.getStorageSync('APP_START_IMG');
			if (start_img) {
				// 图片信息
				uni.getImageInfo({
					src: start_img,
					success: function (image) {
						if (image.height < 1334) {
							that.margin_top = (1334 - image.height) / 3;
						}
						that.background = '#000';
						that.start_img = start_img;
					},
					fail: function (err) {
						that.background = '#000';
						that.start_img = start_img;
					}
				});
			} else {
				uni.switchTab({url: '/pages/index/index'})
			}
		},
		methods: {
		}
	}
</script>
<style>
	page {
		width: 100%;
		height: 100%;
	}
	.start_img {
		width: 100%;
		height: 100%;
		position: fixed;
		z-index: 999999;
	}
</style>